import os

# 获取当前路径
CURRENT_PATH = os.getcwd()
'''人脸检测模块路径常量'''
# 文件上传相对路径
RELATIVE_DETECT_UPLOAD_PATH = os.path.join("data", "detect", "upload")
# 文件结果相对路径
RELATIVE_DETECT_RESULT_PATH = os.path.join("data", "detect", "result")
# 文件上传绝对路径
DETECT_UPLOAD_PATH = os.path.join(CURRENT_PATH, RELATIVE_DETECT_UPLOAD_PATH)
# 文件结果绝对路径
DETECT_RESULT_PATH = os.path.join(CURRENT_PATH, RELATIVE_DETECT_RESULT_PATH)

'''
人脸识别模块路径常量
'''
# 文件上传相对路径
RELATIVE_DISCERN_UPLOAD_PATH = os.path.join("data", "discern", "upload")
# 文件结果相对路径
RELATIVE_DISCERN_RESULT_PATH = os.path.join("data", "discern", "result")
# 文件上传绝对路径
DISCERN_UPLOAD_PATH = os.path.join(CURRENT_PATH, RELATIVE_DISCERN_UPLOAD_PATH)
# 文件结果绝对路径
DISCERN_RESULT_PATH = os.path.join(CURRENT_PATH, RELATIVE_DISCERN_RESULT_PATH)

'''
机器学习模块路径常量
'''
# 文件上传相对路径
RELATIVE_ADMIN_LEARN_UPLOAD_PATH = os.path.join("data", "admin", "upload")
# 文件上传绝对路径
ADMIN_LEARN_UPLOAD_PATH = os.path.join(CURRENT_PATH, RELATIVE_ADMIN_LEARN_UPLOAD_PATH)
# 学习模型数据路径
TRAINER_PATH = os.path.join(CURRENT_PATH, "trainer")


'''特征数据文件路径'''
CASCADE_CLASSIFIER_FILE = os.path.join(CURRENT_PATH, "config", "haarcascade_frontalface_default.xml")

'''生成短UUID字符常量'''
UUID_CHARS = ("a", "b", "c", "d", "e", "f","g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q",
              "r", "s", "t", "u", "v", "w", "x", "y", "z", "0", "1", "2", "3", "4", "5","6", "7",
              "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "I","J", "K", "L", "M", "N", "O",
              "P", "Q", "R", "S", "T", "U", "V","W", "X", "Y", "Z")

'''UUID长度'''
UUID_LEN = 8


'''图片文件类型'''
ALLOWED_IMG_EXTENSIONS = set(['png', 'jpg', 'jpeg', 'gif'])

'''数据库连接信息'''
DB_CONFIG = {
    'host': 'localhost',
    'port': 3306,
    'database': 'faceDetect',
    'user': 'root',
    'password': '123456',
    'charset': 'utf8mb4'
}
